package com.ruoyi.web.controller.jxgl;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.jxgl.domain.*;
import com.ruoyi.jxgl.service.IJxglDvService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 选课Controller
 * 
 * @author ruoyi
 * @date 2023-11-29
 */
@RestController
@RequestMapping("/jxgl/dv")
public class JxglDvController extends BaseController
{
    @Autowired
    private IJxglDvService jxglDvService;

    /**
     * 查询数据总览
     */
    @GetMapping("/summary")
    public AjaxResult getSummary()
    {
        return AjaxResult.success(jxglDvService.selectJxglDvSummaryList());
    }

    /**
     * 查询学期开课统计
     */
    @GetMapping("/deptPercent")
    public TableDataInfo getDeptPercentList()
    {
        List<JxglDvSdeptPercent> list = jxglDvService.selectJxglDvSdeptPercentList();
        return getDataTable(list);
    }

    /**
     * 查询学期开课统计
     */
    @GetMapping("/scNum")
    public TableDataInfo getTermScNumList(@RequestParam Map<String,String> map)
    {
        List<JxglDvCtermScNum> list = jxglDvService.selectJxglDvCtermScNumList(map);
        return getDataTable(list);
    }

    /**
     * 查询工作量Top5
     */
    @GetMapping("/gzlTop5")
    public TableDataInfo getGzlTop5List(@RequestParam Map<String,String> map)
    {
        List<JxglDvGzlTop5> list = jxglDvService.selectJxglDvGzlTop5List(map);
        return getDataTable(list);
    }

    /**
     * 优秀率、不及格率
     */
    @GetMapping("/aePercent")
    public TableDataInfo getAePercentList(@RequestParam Map<String,String> map)
    {
        List<JxglDvAePercent> list = jxglDvService.selectJxglDvAePercentList(map);
        return getDataTable(list);
    }

    /**
     * 学期运行数据
     */
    @GetMapping("/theTermInfo/{theTerm}")
    public TableDataInfo getTheTermInfoList(@PathVariable int theTerm)
    {
        List<Map<String,String>> list = jxglDvService.selectJxglDvTheTermInfoList(theTerm);
        return getDataTable(list);
    }

    /**
     * 查询绩点排行Top50
     */
    @GetMapping("/pointTop50")
    public TableDataInfo getPointTop50List()
    {
        List<JxglDvSpointTop50> list = jxglDvService.selectJxglDvSpointTop50List();
        return getDataTable(list);
    }

}
